<?php

namespace app\common\model;

use think\Model;

class System extends Model
{
    //网站设置信息
    public function system($data)
    {
        $validate = new \app\common\validate\System();
        if (!$validate->check($data)){
            return $validate -> getError();
        }
        $system = $this -> find();
        //dump($system);exit;
        $system -> webname = $data['webname'];
        $system -> copyright = $data['copyright'];
        $system -> icp = $data['icp'];
        $result = $system -> save();
        if ($result){
            return 1;
        } else {
            return '更新失败！';
        }
    }
}
